{extend name="public:_base" /}
{block name="js"}
{include file="public/_validform"}
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/tempname.js"></script>

<script>

    $("[name='pid']").find("[value='{$data.pid ?? ''}']").attr("selected", true);
    $("[name='link']").find("[value='{$data.link ?? ''}']").attr("selected", true);
    $("[name='temppage']").find("[value='{$data.temppage ?? 'page.html'}']").attr("selected", true);
    $('#pid').change(function(){
        var ss = $(this).children('option:selected').attr('id');
        $('#pids').attr('value', ss);
    });
    var ue = UE.getEditor('editor');

    $('#openEditor').click(function() {
        if ($(this).next().css('display') == 'block') {
            $(this).text('展示编辑框');
        }else {
            $(this).text('隐藏编辑框');
        }
        $('.editor').fadeToggle();
    });

    //显示page开头的
    $("[name='temppage']").find("[value^='page']").css('display','inline');
</script>
{/block}
{block name="main"}
<div class="page-container">
    <form action="{:url(\''.\\think\\Request::instance()->controller().'/save')}" method="post" class="form form-horizontal" id="form">

        <table class="table table-border table-bordered table-bg table-style">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <th>
                        导航级别：
                    </th>
                    <td>
                        <select name="pid" id="pid" class="select">
                            <option value="0" id=",">新导航</option>
                            {volist name="getall" id="vo"}
                            <option value="{$vo.id}"  id="{$vo.pids}">{$vo['level']}{$vo.name}</option>
                            {/volist}
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>导航名：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.name ?? ''}" placeholder="" datatype="*1-16" name="name">
                    </td>
                </tr>

                <!--<tr>-->
                    <!--<th>-->
                        <!--<span class="c-red">*</span>英文名：-->
                    <!--</th>-->
                    <!--<td>-->
                        <!--<input type="text" class="input-text" value="{$data.Ename ?? ''}" placeholder="" datatype="*1-16" name="Ename">-->
                    <!--</td>-->
                <!--</tr>-->
                <tr>
                    <th>
                        选择站内链接：
                    </th>
                    <td>
                        <select name="link" class="select">
                            <option value="">不选择</option>
                            {volist name="allnav" id="vo"}
                            <option value="{$vo.link}">{$vo['level']}{$vo.name}</option>
                            {/volist}
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>单页面模板：
                    </th>
                    <td>
                        <select name="temppage"  class="select" placeholder="" datatype="*">
                            {volist name="dirlist" id="vo"}
                            <option value="{$vo.name}" title="{$vo.name}" style="display: none;">{$vo.name}</option>
                            {/volist}
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>
                        内容：
                    </th>
                    <td>
                        <a id="openEditor" class="btn radius btn-xs btn-warning" title="编辑框" style="margin-bottom: 10px;">展开编辑框</a>
                        <script id="editor" class="editor" type="text/plain" name="content" style="width:100%;height:400px;display: none;">{$data.content|default=''|html_entity_decode ?? ''}</script>

                    </td>
                </tr>
            </tbody>

            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        <input name="id" value="{$data.id ?? ''}" type="hidden">
                        <input name="type" value="one" type="hidden">
                        <input name="model" value="about" type="hidden">
                            <input id="pids" name="pids" value="{$data.pids ?? ','}" type="hidden">
                        {:token()}
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </td>
                </tr>
            </tfoot>

        </table>

    </form>

</div>
{/block}